package com.snow.campuslink.lostFound.service.impl;

import com.snow.campuslink.lostFound.converter.dto.UpdateLostFoundActionCountDto;
import com.snow.campuslink.lostFound.entity.LostFoundPost;
import com.snow.campuslink.lostFound.mapper.LostFoundPostMapper;
import com.snow.campuslink.lostFound.service.ILostFoundPostService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

import static cn.hutool.core.bean.BeanUtil.beanToMap;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Gaosl
 * @since 2021-02-12
 */
@Service
public class LostFoundPostServiceImpl extends ServiceImpl<LostFoundPostMapper, LostFoundPost> implements ILostFoundPostService {

    @Resource
    LostFoundPostMapper lostFoundPostMapper;

    @Override
    public void updateActionCount(UpdateLostFoundActionCountDto updateLostFoundActionCountDto) {
        Map<String, Object> map = beanToMap(updateLostFoundActionCountDto, true, true);
        lostFoundPostMapper.updateActionCount(map);
    }
}
